﻿using System;
using System.Collections.Generic;

using DreamCube.Foundation.Basic.Objects;

namespace DreamCube.Foundation.WMI
{
    /// <summary>
    /// 磁盘信息实体类
    /// </summary>
    public class HardDiskModel
    {
        #region "属性"

        /// <summary>
        /// 一个扇区的字节数
        /// </summary>
        [ManagementObjectPropertyMapping("BytesPerSector")]
        public UInt32 BytesPerSector
        {
            get;
            set;
        }

        /// <summary>
        /// 描述
        /// </summary>
        [ManagementObjectPropertyMapping("Description")]
        public String Description
        {
            get;
            set;
        }

        /// <summary>
        /// 标题名称
        /// </summary>
        [ManagementObjectPropertyMapping("Caption")]
        public String Caption
        {
            get;
            set;
        }

        [ManagementObjectPropertyMapping("Model")]
        public String Model
        {
            get;
            set;
        }

        [ManagementObjectPropertyMapping("PNPDeviceID")]
        public String PNPDeviceID
        {
            get;
            set;
        }

        /// <summary>
        /// 每个磁道的扇区数
        /// </summary>
        [ManagementObjectPropertyMapping("SectorsPerTrack")]
        public UInt32 SectorsPerTrack
        {
            get;
            set;
        }

        /// <summary>
        /// 硬盘标记
        /// </summary>
        [ManagementObjectPropertyMapping("Signature")]
        public UInt32 Signature
        {
            get;
            set;
        }

        /// <summary>
        /// 序列号
        /// </summary>
        [ManagementObjectPropertyMapping("SerialNumber")]
        public String SerialNumber
        {
            get;
            set;
        }

        /// <summary>
        /// Small Computer System Interface（小型计算机系统接口）
        /// </summary>
        [ManagementObjectPropertyMapping("SCSIBus")]
        public UInt32 SCSIBus
        {
            get;
            set;
        }

        /// <summary>
        /// 固件ID
        /// </summary>
        [ManagementObjectPropertyMapping("FirmwareRevision")]
        public String FirmwareRevision
        {
            get;
            set;
        }

        [ManagementObjectPropertyMapping("LastErrorCode")]
        public UInt32 LastErrorCode
        {
            get;
            set;
        }

        /// <summary>
        /// 制作商
        /// </summary>
        [ManagementObjectPropertyMapping("Manufacturer")]
        public String Manufacturer
        {
            get;
            set;
        }

        /// <summary>
        /// 序号
        /// </summary>
        [ManagementObjectPropertyMapping("Index")]
        public UInt32 Index
        {
            get;
            set;
        }

        /// <summary>
        /// 设备ID
        /// </summary>
        [ManagementObjectPropertyMapping("DeviceID")]
        public String DeviceID
        {
            get;
            set;
        }

        /// <summary>
        /// 状态
        /// </summary>
        [ManagementObjectPropertyMapping("Status")]
        public String Status
        {
            get;
            set;
        }

        /// <summary>
        /// 总磁头数
        /// </summary>
        [ManagementObjectPropertyMapping("TotalHeads")]
        public UInt32 TotalHeads
        {
            get;
            set;
        }

        /// <summary>
        /// 总磁道数
        /// </summary>
        [ManagementObjectPropertyMapping("TotalTracks")]
        public UInt64 TotalTracks
        {
            get;
            set;
        }

        /// <summary>
        /// 总扇区数
        /// </summary>
        [ManagementObjectPropertyMapping("TotalSectors")]
        public UInt64 TotalSectors
        {
            get;
            set;
        }

        /// <summary>
        /// 每一个柱面的磁道数
        /// </summary>
        [ManagementObjectPropertyMapping("TracksPerCylinder")]
        public UInt32 TracksPerCylinder
        {
            get;
            set;
        }

        /// <summary>
        /// 总柱面数
        /// </summary>
        [ManagementObjectPropertyMapping("TotalCylinders")]
        public UInt64 TotalCylinders
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        [ManagementObjectPropertyMapping("Name")]
        public String Name
        { get; set; }

        /// <summary>
        /// 容量（MB为单位）
        /// </summary>
        [ManagementObjectPropertyMapping("Size", typeof(FileSystemSizeDataConvert))]
        public FileSystemSize Size
        { get; set; }

        /// <summary>
        /// 接口
        /// </summary>
        [ManagementObjectPropertyMapping("InterfaceType")]
        public String InterfaceType
        { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        [ManagementObjectPropertyMapping("MediaType")]
        public String MediaType
        {
            get;
            set;
        }

        /// <summary>
        /// 分区
        /// </summary>
        public List<HardDiskPartitionModel> Partitions
        {
            get;
            set;
        }

        #endregion

        public HardDiskModel()
        {
            Partitions = new List<HardDiskPartitionModel>();
        }
    }
}
